package com.lizhenhua.orderitemquery.service.impl;

import com.lizhenhua.fmmall.entity.OrderItem;
import com.lizhenhua.orderitemquery.mapper.OrderItemMapper;
import com.lizhenhua.orderitemquery.service.QueryOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class QueryOrderItemServiceImpl implements QueryOrderItemService {
    @Autowired
    private OrderItemMapper mapper;

    @Override
    public List<OrderItem> queryOrderItem(String orderId) {

        Example example = new Example(OrderItem.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("orderId",orderId);
        List<OrderItem> orderItems = mapper.selectByExample(example);

        return orderItems;
    }
}
